<?php
use yii\helpers\Html;
use app\assets\AppAsset;
use eric\widgets\NavBar;

/* @var $this \yii\web\View */
/* @var $content string */

AppAsset::register($this);
$brandLabel = "YII2 OF ERIC";
?>
<?php $this->beginPage() ?>
<!DOCTYPE html>
<html lang="<?= Yii::$app->language ?>">
<head>
    <meta charset="<?= Yii::$app->charset ?>"/>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <?= Html::csrfMetaTags() ?>
    <title><?= Html::encode($this->title) ?></title>
    <?php $this->head() ?>
    <link href="/css/site.css" rel="stylesheet">
</head>
<body>

<?php $this->beginBody() ?>
<header id="header">
    <?php
    echo NavBar::widget([
        'brandLabel' => $brandLabel,
        'brandUrl' => Yii::$app->homeUrl,
        'options' => ['class' => ' navbar-fixed-top'],
        'navList' => [
            [
                'items' => [
                    '<li><a href="/"><i class="fa fa-home fa-lg"></i></a></li>',
                ]
            ],
            [
                'align' => 'right',
                'items' => [
                    '<li><span class="navbar-devider"></span></li>',
                    [
                        'label' => \Yii::$app->user->identity->name,
                        'url' => 'javascript:void(0);',
                        'linkOptions' => [
                            'class' => 'navbar-profile dropdown-toggle text-bold',
                            'data-toggle' => 'dropdown'
                        ],
                        'items' => [
                            '<li class="dropdown-header">个人中心</li>',
                            '<li><a href="#">My profile</a></li>',
                            '<li class="divider"></li>',
                            '<li><a href="/site/logout" data-method="post"><i class="fa fa-fw fa-power-off text-danger"></i>Logout</a></li>'
                        ]
                    ],
                ]
            ]
        ],
    ]);

    ?>
</header>

<div id="base">
    <div id="sidebar">
        <?=\eric\widgets\SideBar::widget([
            'brandLabel' => $brandLabel,
            'brandUrl' => Yii::$app->homeUrl,
            'items' => [
                [
                    'class' => \eric\widgets\SideBarSearch::className(),
                ],
                [
                    'class' => \eric\widgets\SideMenu::className(),
                    'items' => \mdm\admin\components\MenuHelper::getAssignedMenu(Yii::$app->user->id),
                ]
            ]
        ]);
        ?>
    </div>

    <div id="content">
        <section>
            <?= \yii\widgets\Breadcrumbs::widget([
                'links' => isset($this->params['breadcrumbs']) ? $this->params['breadcrumbs'] : [],
                'tag' => 'ol'
            ]) ?>
            <?=$content?>
        </section>
    </div>
</div>

<div id="footer" class="footer">
    <div class="container">
        <p class="text-center">&copy; 星源华聚 <?= date('Y') ?> www.stargather.cn</p>
    </div>
</div>

<?php $this->endBody() ?>
</body>
</html>
<?php $this->endPage() ?>
